package com.pan.admin.module.api.service;

import com.pan.admin.module.api.entity.ApiKey;
import com.pan.admin.module.api.entity.vo.ApiKeyBalanceOperationVO;
import com.pan.admin.module.api.entity.vo.ReqApiKeyVO;

import java.util.List;
import java.util.Map;


/**
 * keysService接口
 *
 * @author ts
 * @date 2023-10-26
 */
public interface ApiKeyService {

    /**
     * api渠道
     */
    List<Map<String, Object>> listApiKey(String keyword);

    /**
     * 根据ID获取列表keys
     *
     * @param id keys主键
     * @return keys
     */
    ApiKey getById(Long id);

    /**
     * 查询keys列表
     *
     * @param apiKeys keys
     * @return keys集合
     */
    List<ApiKey> list(ApiKey apiKeys);

    /**
     * 查询keys列表-从库
     *
     * @param apiKeys keys
     * @return keys集合
     */
    List<ApiKey> listSlave(ApiKey apiKeys);


    /**
     * 新增keys
     *
     * @param reqApiKeyVO
     * @return 结果
     */
    int insertApiKeys(ReqApiKeyVO reqApiKeyVO);

    /**
     * 复制keys
     *
     * @param apiKey
     * @return 结果
     */
    ApiKey copyApiKeys(ApiKey apiKey);

    /**
     * 修改keys
     *
     * @param reqApiKeyVO
     * @return 结果
     */
    int updateApiKeys(ReqApiKeyVO reqApiKeyVO);

    /**
     * 重置密钥
     */
    int resetApiKeys(ApiKey apiKeys);


    /**
     * 查重
     */
    boolean checkApiName(ApiKey apiKeys);

    /**
     *
     *  功能描述: 根据api_client_id 获取
     *  @author hrj
     *
     *  @param id
     *  @return ApiKey
     */
    ApiKey getByApiClientId(String id);

    /**
     * 余额操作
     */
    void balanceOperation(ApiKeyBalanceOperationVO balanceOperationVO);
}
